﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Admin_Contact_Default" %>
<%@ Register Assembly="Jalal.Library" Namespace="Jalal.Library.Web.Control" TagPrefix="ucc" %>
<%@ Register Src="~/Controls/wucDatePicker.ascx" TagName="DatePicker" TagPrefix="wuc" %>
<%@ Register Src="~/Controls/wucEmptyGridMessage.ascx" TagName="EmptyGridMessage" TagPrefix="wuc" %>
<%@ Import Namespace="Jalal.Library.Utility" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="<%= siteRoot %>Javascripts/Common/ApplicationCommon.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MiddleArea" Runat="Server">
    <table cellpadding="10" border="0" cellspacing="10" class="table_area" width="90%">
        <tr>
            <td class="heading-text">
                Contacts
            </td>
        </tr>
        <tr>
            <td>
                <ucc:ResponseMessage ID="uccResponse" runat="server"></ucc:ResponseMessage>
            </td>
        </tr>
        <tr>
            <td align="center">
                <table class="search_box">
                    <tr>
                        <td>
                            <table cellpadding="5" cellspacing="5">
                                <tr align="left">
                                    <td>Contacted By <asp:TextBox ID="tbxName" runat="server"></asp:TextBox></td>
                                    <td class="gap">&nbsp;</td>
                                    <td>Organization <asp:TextBox ID="tbxOrganization" runat="server"></asp:TextBox></td>
                                    <td class="gap">&nbsp;</td>
                                    <td>Read
                                        <asp:DropDownList ID="ddlUnread" runat="server">
                                            <asp:ListItem Text="All" Value="-1" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="Read" Value="True"></asp:ListItem>
                                            <asp:ListItem Text="Unread" Value="False"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="5" cellspacing="5">
                                <tr align="left">
                                    <td>Contact Date Between</td>
                                    <td><wuc:DatePicker ID="contactDateFrom" runat="server" YearFrom="2009" YearTo="2020" /></td>
                                    <td class="gap">&nbsp;</td>
                                    <td>To</td>
                                    <td><wuc:DatePicker ID="contactDateTo" runat="server" YearFrom="2009" YearTo="2020" /></td>
                                    <td align="right">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="button" OnClick="Search_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="right">
                <table>
                    <tr>
                        <td>
                            <asp:DropDownList ID="ddlActionType" runat="server">
                                <asp:ListItem Text="Mark as read" Value="Read"></asp:ListItem>
                                <asp:ListItem Text="Mark as unread" Value="Unread"></asp:ListItem>
                                <asp:ListItem Text="Copy to address book" Value="SaveAddress"></asp:ListItem>
                                <asp:ListItem Text="Delete" Value="Delete"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:Button ID="btnUpadate" runat="server" Text="Confirm" 
                                CssClass="button" OnCommand="Update_Command" CommandName="Update" CommandArgument="Top" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="grvContacts" runat="server" AutoGenerateColumns="false" PageSize="20" AllowPaging="false"
                    AllowSorting="false" OnRowDataBound="Grid_RowDataBound" HeaderStyle-Font-Bold="true" GridLines="None" 
                    Width="100%" AlternatingRowStyle-BackColor="#F5F5F5" CellPadding="0" CellSpacing="0" 
                    BorderColor="#EEEEEE" BorderStyle="Solid" BorderWidth="1px" >
                    <HeaderStyle BackColor="#EEEEEE" Font-Bold="true" ForeColor="#333333" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <table>
                                    <tr>
                                        <td rowspan="2" valign="middle">
                                            #</td>
                                        <td>
                                            <ucc:SortButton ID="SortButton1" IsSortUpButton="true" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ContactId" /></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <ucc:SortButton ID="SortButton2" IsSortUpButton="false" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ContactId Desc" /></td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="lblId" runat="server" Text='<%# Eval("ContactId") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <table>
                                    <tr>
                                        <td rowspan="2" valign="middle">
                                            Contacted By</td>
                                        <td>
                                            <ucc:SortButton ID="SortButton3" IsSortUpButton="true" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ClientName" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <ucc:SortButton ID="SortButton4" IsSortUpButton="false" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ClientName Desc" />
                                        </td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            <ItemTemplate>
                                <asp:Label ID="lblClientName" runat="server" Text='<%# Eval("ClientName") %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <table>
                                    <tr>
                                        <td rowspan="2" valign="middle">
                                            Subject</td>
                                        <td>
                                            <ucc:SortButton ID="SortButton5" IsSortUpButton="true" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ContactSubject" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <ucc:SortButton ID="SortButton6" IsSortUpButton="false" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ContactSubject Desc" />
                                        </td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            <ItemTemplate>
                                <asp:HyperLink ID="hlkContactSubject" runat="server" Text='<%# Eval("ContactSubject") %>' Width="300px" ></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <table>
                                    <tr>
                                        <td rowspan="2" valign="middle">
                                            Contacted On</td>
                                        <td>
                                            <ucc:SortButton ID="SortButton7" IsSortUpButton="true" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort"  CommandArgument="ContactDateTime" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <ucc:SortButton ID="SortButton8" IsSortUpButton="false" runat="server"
                                                OnCommand="Grid_Sort" CommandName="Sort" CommandArgument="ContactDateTime Desc" />
                                        </td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="lblCreateDateTime" runat="server" 
                                    Text='<%# CommonUtility.FormatedDateString((DateTime)Eval("ContactDateTime")) %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                Read
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:HyperLink ID="hlkReadMessage" runat="server"><ucc:ThemeImage ID="imgRead" runat="server" /></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderStyle HorizontalAlign="Center" />
                            <HeaderTemplate>
                                <asp:CheckBox ID="cbxSelectAll" runat="server" />
                            </HeaderTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:CheckBox ID="cbxSelect" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <wuc:EmptyGridMessage ID="EmptyGridMessage1" runat="server" MessageText="There is no record" />
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Repeater ID="rptPager" runat="server" OnItemDataBound="Pager_DataBound">
                    <ItemTemplate>
                        <asp:LinkButton ID="lkbPageIndex" runat="server" CssClass="page-index" 
                            Text='<%# Container.DataItem.ToString() %>' CommandName="PagingCommand"
                            CommandArgument='<%# Container.DataItem %>'
                            OnCommand="Page_Change"></asp:LinkButton>
                    </ItemTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
            <td align="left">
                <table>
                    <tr>
                        <td>
                            <asp:DropDownList ID="ddlActionType2" runat="server">
                                <asp:ListItem Text="Mark as read" Value="Read"></asp:ListItem>
                                <asp:ListItem Text="Mark as unread" Value="Unread"></asp:ListItem>
                                <asp:ListItem Text="Delete" Value="Delete"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:Button ID="btnUpdate2" runat="server" Text="Confirm" 
                                OnCommand="Update_Command" CommandName="Update" CommandArgument="Bottom" CssClass="button" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>

